package org.sidora.core.context;

import java.awt.BasicStroke;
import java.awt.Color;
import java.net.URL;
import java.util.HashSet;
import java.util.TreeSet;

import javax.swing.ImageIcon;
import org.sidora.core.Category;
import org.sidora.core.Variable;


/**
 * Surface
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class Surface extends Context{
    
    public TreeSet <Category>activityTraces = new TreeSet<Category>();
    
    public TreeSet<Category> getActivityTraces() {
        return activityTraces;
    }
    
    public void setActivityTraces(TreeSet<Category> activityTraces) {
        this.activityTraces = activityTraces;
    }
    public ImageIcon getIcon() {
        return new javax.swing.ImageIcon(getClass().getResource("/org/sidora/core/context/resources/surface16.png"));
    }        
    
    public String getStringClass() {
        
        return "Surface";
    }
    public HashSet<Variable> getVariableSet() {
        HashSet<Variable> vSet = new HashSet<Variable>();
        String [] labels = {"Traces d'Activitat"};
        
        for (int i =0 ; i< labels.length; i++){
            Variable var = new Variable();
            var.setLabel(labels[i]);
            var.setReferencedClass(this.getStringClass());
            vSet.add(var);
        }
        return vSet;
    }
    
    public String outputVariables(){
        
        
        StringBuffer buf = new StringBuffer();
        buf.append("<html>");
        buf.append("<body>");
        
        buf.append("<table width=\'100%\' border=\'0\' cellspacing=\'0\' cellpadding=\'1\' bgcolor=\'white\'>");
        buf.append("		<tr align=\'right\'bgcolor=\'#EFEC7B\'>");
        buf.append("			<th align=\'right\'><font size=\'3\'color=\'black\' face=\'Lucida\'>Categories:</font></th>");
        buf.append("			<th align=\'left\'></th>");
        buf.append("		</tr>");
        buf.append("		<tr>");
        buf.append("			<td align=\'right\' width=\'25%\'><font size=\'3\'color=\'black\' face=\'Lucida\'><em>Traces d'activitat:</em></font></td>");
        buf.append("			<td><font size=\'3\'color=\'black\' face=\'Lucida\'>"+activityTraces+"</font></td>");
        buf.append("		</tr>");
        
        buf.append("</table>");
        
        buf.append("</body>");
        buf.append("</html>");
        
        return buf.toString();
    }
}